{% load django_ledger %}
{% load trans from i18n %}

<div class="card">
    <div class="card-content">
        <div class="has-text-centered">
            <h2 class="is-size-4 has-font-weight-medium">
                {% if has_year %}Fiscal Year {{ to_date.year }}{% endif %}
            </h2>
            <h2 class="is-size-5">
                {% if has_month %}{{ to_date | date:"F" }}{% endif %}
                {% if has_quarter %}Q{{ quarter }}{% endif %}
                {% if has_date %}{{ to_date | date }}{% endif %}
            </h2>
        </div>

        <p>Year:
            <a href="{{ previous_year_url }}"><< {{ previous_year }}</a> |
            <a href="{{ current_year_url }}">{{ year }}</a> |
            <a href="{{ next_year_url }}">{{ next_year }} >></a>
        </p>

        <p>Quarter:
            {% for q_url in quarter_urls %}
                <a href="{{ q_url.url }}">{{ q_url.quarter_name }}</a> {% if not forloop.last %}|{% endif %}
            {% endfor %}
        </p>
        <p>{% trans 'Month' %}:
            {% for m_url in month_urls %}
                <a href="{{ m_url.url }}">{{ m_url.month_abbr }}</a> {% if not forloop.last %}|{% endif %}
            {% endfor %}
        </p>
        <div class="has-text-centered">
            {% if has_date %}
                <p class="has-text-weight-bold is-italic mt-2">{{ from_date | date:"m/d/Y" }}</p>
            {% else %}
                <p class="has-text-weight-bold is-italic mt-2">
                    {{ from_date | date:"m/d/Y" }}
                    {% trans 'thru' %}
                    {{ to_date | date:"m/d/Y" }}</p>
            {% endif %}

            <a href="{{ current_month_url }}">{% trans 'Go To Current Month' %}</a>
        </div>
        <div class="has-text-centered">
            {% date_picker date_navigation_url %}
        </div>
    </div>
</div>
